<clr-datagrid [clrDgLoading]="loading" [clrDgSelected]="selected">
    <clr-dg-action-bar *ngIf="currentCluster.source !== 'external'">
        <button type="button" class="btn btn-sm btn-secondary" (click)="onCreate()">
            <clr-icon shape="plus" size="16"></clr-icon>
            {{"APP_ADD"|translate}}
        </button>
        <button type="button" class="btn btn-sm btn-secondary" (click)="onDelete()" [disabled]="selected.length<1">
            <clr-icon shape="close"></clr-icon>
            {{"APP_DELETE"|translate}}
        </button>
    </clr-dg-action-bar>
    <clr-dg-column>{{"APP_NAME"|translate}}</clr-dg-column>
    <clr-dg-column>{{"APP_IP"|translate}}</clr-dg-column>
    <clr-dg-column>{{"APP_VERSION"|translate}}</clr-dg-column>
    <clr-dg-column>Roles</clr-dg-column>
    <clr-dg-column>CPU</clr-dg-column>
    <clr-dg-column>RAM</clr-dg-column>
    <clr-dg-column>{{"APP_STATUS"|translate}}</clr-dg-column>
    <clr-dg-column>{{"APP_CREATED_DATE"|translate}}</clr-dg-column>
    <clr-dg-row *clrDgItems="let item of items" [clrDgItem]="item"
                [clrDgSelectable]="currentCluster.source !== 'external' && getNodeRoles(item).indexOf('master')===-1">
        <clr-dg-cell><a href="javascript:void(0)" (click)="onDetail(item)">{{item.name}}</a></clr-dg-cell>
        <clr-dg-cell>{{getInternalIp(item)}}</clr-dg-cell>
        <clr-dg-cell>{{getVersion(item)}}</clr-dg-cell>
        <clr-dg-cell>{{getNodeRoles(item)}}</clr-dg-cell>
        <clr-dg-cell>{{getCpuCore(item)}}</clr-dg-cell>
        <clr-dg-cell>{{getRAM(item)}}</clr-dg-cell>
        <clr-dg-cell *ngIf="getStatus(item) !== 'Failed'">{{getStatus(item) |translate}}
            <clr-spinner clrAssertive clrInline *ngIf="item.status === 'Initializing' || item.status === 'Terminating'">
                Loading...
            </clr-spinner>
        </clr-dg-cell>
        <clr-dg-cell *ngIf="getStatus(item) === 'Failed'"><a href="javascript:void(0)"
                                                             (click)="onShowStatus(item)">
            {{getStatus(item) | translate}}
        </a>
        </clr-dg-cell>
        <clr-dg-cell>{{item.createdAt|date:'yyyy-MM-dd HH:mm:ss'}}</clr-dg-cell>
    </clr-dg-row>
</clr-datagrid>

